package cn.itcast.order.controller;

import cn.itcast.hmall.dto.common.ResultDTO;
import cn.itcast.hmall.pojo.user.User;
import cn.itcast.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/pay")
public class PayController {
    @Autowired
    private OrderService orderService;
    @PutMapping("/{orderId}")
    public ResultDTO payOrder(@PathVariable("orderId") String orderId ,@RequestBody User user){
        System.out.println(orderId);
        System.out.println(user);
        return orderService.payOrder(orderId,user);
    }
}
